import React, { Component } from 'react'
import { Pagination } from 'antd';
import { bindActionCreators } from "redux"
import { connect } from "react-redux"
import * as action from "../action/tableIndex"
class Fenye extends Component {
  componentDidMount(){
    this.props.getList1()
  }
  setTable(page, pageSize){
    console.log(page,pageSize);
    this.props.changefn(page)
  }
  render() {
    return (
      <div>
           {
              this.props.arr && this.props.arr.length && <Pagination defaultCurrent={1}  pageSize={5} total={this.props.arr.length} onChange={this.setTable.bind(this)} />
           } 
      </div>
    )
  }
}
let mapStateToprops = (state) => {
    return {
      ...state.tablereducer
    }
  }
let mapDsipatchToProps = (dispatch) => bindActionCreators(action, dispatch)
export default connect(mapStateToprops, mapDsipatchToProps)(Fenye)
